using System;
using L=Science.Physics.GeneralPhysics;

namespace Serway.Chapter10
{
	/// <summary>
	/// Example02: CD Player
	/// On a compact disc (Figure 10.6), audio information is 
	/// stored in a series of pits and flat area on the surface 
	/// of the disc. The information is stored digitally, and 
	/// the alternations between pits and flat areas on the 
	/// surface represent binary ones and zeroes to be read by 
	/// the compact disc player and detected by a system 
	/// consisting of a laser and lenses. The length of a string 
	/// of ones and zeroes representing one piece of information 
	/// is near the center of the disc or near its outer edge. 
	/// In orther that this length of ones and zeroes always passes 
	/// by the laser lens system in the same time period , 
	/// the tangential speed of the disc surface at the location 
	/// of the lens must be constant. This requires, according 
	/// to Equation 10.10, that the angular speed vary as the laser 
	/// lens system moves radially along the disc player, 
	/// the constant speed of the surface at the point of the laser 
	/// len system is 1.3 m/s.
	/// (A) Find the angular speed of the disc in revolutions 
	/// per minute when information is being read from the 
	/// innermost first track (r = 23 mm) and the outermost final 
	/// track (r = 58mm)
	/// \omega_i = 5.4 \times 10^2 rev/min
	/// \omega_f = 2.1 \times 10^2 rev/min
	/// (B) The maximum playing time of a standard music CD 
	/// is 74 min and 33 s. How many revolutions does the disc 
	/// make during that time?
	/// \Delta \theta = 2.8 times 10^4 rev
	/// (C) What total length of track moves past the objective 
	/// lens during this time?
	/// x_f = 5.8 \times 10^3 m
	/// (D) What is the angular acceleration of the CD over 
	/// the 4473 s time interval? Assume that is constant.
	/// \alpha = -7.8 \times 10^{-3} rad/s^2
	/// </summary>
	public class Example02
	{
		public Example02()
		{
		}
		private string result;
		public string Result
		{
			get{return result;}
		}
		public void Compute()
		{
			L.Velocity v = new L.Velocity();
			v.Y = 1.3;
			L.Length inner = new L.Length();
			inner.m = 23.0*0.001;
			L.Length outer = new L.Length();
			outer.m = 58.0*0.001;
			L.AngularVelocity omegain = new L.AngularVelocity();
			omegain.Z = v.Y/inner.m;
			L.AngularVelocity omegaout = new L.AngularVelocity();
			omegaout.Z = v.Y/outer.m;
			//(A)
			result+=Convert.ToString(
				omegain.Z*60.0/2.0/Math.PI)+"\r\n";
			result+=Convert.ToString(
				omegaout.Z*60.0/2.0/Math.PI)+"\r\n";
			//(B)
			result+=Convert.ToString(
				(omegain.Z+omegaout.Z)/2.0*60.0/2.0/Math.PI
				*(74.0+33.0/60.0))+"\r\n";
			//(C)
			result+=Convert.ToString(v.Y*(74.0*60.0+33.0))+"\r\n";
			//(D)
			L.Time t = new L.Time();
			t.s = 4473.0;
			L.AngularAcceleration alpha = new L.AngularAcceleration(omegaout,omegain,t);
			result+=Convert.ToString(alpha.Z);
		}
	}
}
